import cn.edu.hbsi.dao.GaoTianYuanDao;
import cn.edu.hbsi.dao.UserDao;
import cn.edu.hbsi.domain.GaoTianYuan;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Iterator;
import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringJUnitConfig(locations = "classpath:spring-mvc.xml")
public class test
{
    @Autowired
    private UserDao userDao;

    @Autowired
    private GaoTianYuanDao gaoTianYuanDao;

    @Test
    public void test1(){
        System.out.println("======================");
        System.out.println(userDao.selectById(1));
        System.out.println("======================");
    }

    @Test
    public void test2(){
        System.out.println("======================");
        System.out.println(gaoTianYuanDao.selectById(1));
        System.out.println("======================");
        List<GaoTianYuan> list = gaoTianYuanDao.selectList(null);
        Iterator var = list.iterator();
        while (var.hasNext()){
            GaoTianYuan gaoTianYuan = (GaoTianYuan) var.next();
            System.out.println(gaoTianYuan);
        }
    }
}